// TEX0_IncomingCall.cpp : implementation file
//

#include "stdafx.h"
#include "TEX0_Demo.h"
#include "TEX0_IncomingCall.h"
#include "afxdialogex.h"


// CTEX0_IncomingCall dialog

IMPLEMENT_DYNAMIC(CTEX0_IncomingCall, CDialogEx)

CTEX0_IncomingCall::CTEX0_IncomingCall(CWnd* pParent /*=NULL*/)
	: CDialogEx(CTEX0_IncomingCall::IDD, pParent)
	, m_callInfo(_T(""))
{

}

CTEX0_IncomingCall::~CTEX0_IncomingCall()
{
}

void CTEX0_IncomingCall::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_STATIC_CALL_INFO, m_callInfo);
}


BEGIN_MESSAGE_MAP(CTEX0_IncomingCall, CDialogEx)
	ON_BN_CLICKED(IDOK, &CTEX0_IncomingCall::OnBnClickedOk)
	ON_BN_CLICKED(IDCANCEL, &CTEX0_IncomingCall::OnBnClickedCancel)
	ON_WM_SHOWWINDOW()
END_MESSAGE_MAP()


// CTEX0_IncomingCall message handlers


BOOL CTEX0_IncomingCall::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  Add extra initialization here
	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}


void CTEX0_IncomingCall::OnShowWindow(BOOL bShow, UINT nStatus)
{
	CDialogEx::OnShowWindow(bShow, nStatus);

	// TODO: Add your message handler code here
	UpdateData(FALSE);
}


void CTEX0_IncomingCall::SetCallInfo(int callHandle, CString info)
{
	m_callHandle = callHandle;
	m_callInfo = info;
}


void CTEX0_IncomingCall::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	int ret = incomingCallProcess(1, 0, m_callHandle);

	CDialogEx::OnOK();
}


void CTEX0_IncomingCall::OnBnClickedCancel()
{
	// TODO: Add your control notification handler code here
	int ret = incomingCallProcess(0, 0, m_callHandle);

	CDialogEx::OnCancel();
}
